package br.sed.theenemy.presentation.action.json.exception;

/**
 * This class should be used to identify errors occurring in the system.
 * JsonBaseAction2 class actions are prepared to show an error id in its result
 * in case the thrown Exception is an instance of this class or of its
 * subclasses.
 * 
 * @author JulioCB
 * @email jcbjulio@gmail.com
 */
public class IdentifiedException extends Exception {

	private static final long serialVersionUID = 3336427495441080726L;
	
	private final String id;

    /**
     * Constructs a new exception with the specified detail message and cause.
     * 
     * @param id String with the identification to be specified in the detail message.
     * @param cause The cause.
     * */
    public IdentifiedException(final String id, final Throwable cause) {
        super(cause);
        this.id = id;
    }

    /**
     * Returns the string with the identification to be specified in the detail message.
     * 
     * @return id String with the identification to be specified in the detail message.
     * */
    public String getId() {
        return id;
    }
}
